namespace Vit.Site.Models
{
    using System.Configuration;
    using System.Data.Common;
    using System.Data.SqlClient;
    
    partial class AspNetDb
    {
        public const string ConnectionStringName = "ApplicationServices";

        public AspNetDb() :
            base(CreateConnection(), mappingSource)
        {
            OnCreated();
        }

        private static DbConnection CreateConnection()
        {
            string connString = ConfigurationManager.ConnectionStrings[ConnectionStringName].ConnectionString;
            SqlConnection sqlConn = new SqlConnection(connString);
            return sqlConn;
            //DbConnectionWrapper connWrapper = new DbConnectionWrapper(sqlConn);
            //return connWrapper;
        }
    }
}
